package cn.doitedu.other;

import java.io.Serializable;

public class IpBean implements Comparable<IpBean>, Serializable {
    private long start;
    private long end;
    private String province;
    private String city;

    public IpBean() {
    }

    public IpBean(long start, long end, String province, String city) {
        this.start = start;
        this.end = end;
        this.province = province;
        this.city = city;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public long getEnd() {
        return end;
    }

    public void setEnd(long end) {
        this.end = end;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Override
    public int compareTo(IpBean o) {
        if(this.start>o.end) return 1;
        if(this.end<o.start) return -1;

        return 0;
    }


    @Override
    public String toString() {
        return "IpBean{" +
                "start=" + start +
                ", end=" + end +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                '}';
    }
}
